package com.sephiron.clocksynchronizer;



import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.RelativeLayout;

public class HelpActivity extends Activity {
	public static final String EXTRA_HELP_MODE = "com.sephiron.clocksynchronizer.help_mode";

	public static final int CCTV_LIST_HELP = 0;
	public static final int TIME_SYNC_HELP = 1;
	public static final int TIME_SYNC_EDIT_MODE_HELP = 2;

	private int mode = 0;
	private RelativeLayout rl;
	private OnClickListener closeOnTouch;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		mode = getIntent().getIntExtra(HelpActivity.EXTRA_HELP_MODE, mode);
		
		closeOnTouch = new OnClickListener() {
			@Override
			public void onClick(View v) {
				finish();
			}
		};
		
		switch (mode) {
		case CCTV_LIST_HELP:
			setContentView(R.layout.help_cctv_list);
			rl = (RelativeLayout) findViewById(R.id.relativeLayoutHelpCctvList);
			rl.setOnClickListener(closeOnTouch);
			break;
		case TIME_SYNC_HELP:
			setContentView(R.layout.help_time_sync);
			rl = (RelativeLayout) findViewById(R.id.relativeLayoutHelpTimeSync);
			rl.setOnClickListener(closeOnTouch);
 			break;
		case TIME_SYNC_EDIT_MODE_HELP:
			setContentView(R.layout.help_time_sync_edit_mode);
			RelativeLayout rl = (RelativeLayout) findViewById(R.id.relativeLayoutHelpTimeSyncEditMode);
			rl.setOnClickListener(closeOnTouch);
			break;
		}
	}
}
	
